#pragma once

#include <string>

std::string num2str(int i) {
	std::string ret="";

	if (0<=i && i<=9) {
		ret=i+'0';
		return ret;
	}

	bool bNeg=(i < 0);
	i=abs(i); 

	while (i!=0) {
		std::string save=ret;
		ret=('0'+(i%10));
		ret+=save; 
		i/=10;
	}

	if (bNeg)
		ret = "-" + ret;

	return ret;
}